<g:each in="${Regulation}" var ="prot">
  <div class="line heatmapline">
    <div class="element protein"><g:link controller="Protein" action="show" id="${prot.protein}" target="_blank">${Proteins[prot.protein].mainId}</g:link></div>
    <div class="element gene">
      <g:set var="gene" value="" />
      <g:each in="${Proteins[prot.protein].genes}" var="foundGenes" >
        <g:set var="gene" value="${((gene.size()==0)||(foundGenes.name.size()<=gene.size()))?foundGenes.name:gene}" />
      </g:each>
      ${gene}
    </div>
  <g:each in="${Celllines}" var="line">
    <g:if test="${prot.cls[line]!=null}">
      <g:if test="${line==RefLine}">
        <g:remoteLink controller="Protein" action="expressionPlots" params="${[protein:prot.protein, cellline:line, celllines:Celllines, up:Up, down:Down, non:Non, refLine:RefLine, pValues:prot.projPValues]}" update="box" class="element regulation reference" target="_blank" >
          <div class="ref">R</div>
          <div class="bg"></div>
        </g:remoteLink>
      </g:if>
      <g:else>
        <g:remoteLink controller="Protein" action="expressionPlots" params="${[protein:prot.protein, cellline:line, celllines:Celllines, up:Up, down:Down, non:Non, refLine:RefLine, pValues:prot.projPValues]}" update="box" class="element regulation ${prot.cls[line].regClass}" target="_blank" >
          <g:if test="${prot.cls[line].up!=0}"><div class="up">${prot.cls[line].up}</div></g:if>
          <g:if test="${prot.cls[line].down!=0}"><div class="down">${prot.cls[line].down}</div></g:if>
          <g:if test="${prot.cls[line].non!=0}"><div class="non">${prot.cls[line].non}</div></g:if>
          <div class="bg"></div>
        </g:remoteLink>
      </g:else>
    </g:if>
    <g:else>
      <div class="element regulation class000"></div>
    </g:else>
  </g:each>
    <div class="element description">${Proteins[prot.protein].description }</div>
  </div>
</g:each>

<g:if test="${Regulation.size()==MaxEntries}">
  <div id="listNext${Offset}">
    <div class="line listline">
      <g:remoteLink action="globalExpressionResults" update="listNext${Offset}" params="${Params}" class="loadNext element">Load Next</g:remoteLink>
      <script type="text/javascript">nextNotClicked = true;</script>
    </div>
  </div>
</g:if>
